rm(list = ls())

# packages 

library(tidyverse)
library(fixest)

# Load data + dictionary 

dat <- readRDS('data/civey_clean.rds') %>%
  filter(freibad_in_zip == 1) %>%
  mutate(foreign_non_eu_share_bin_high = ifelse(foreign_non_eu_share_bin == 'High', 1, 0),
         summer_bin_foreign_non_eu_share_bin_high = summer_bin*foreign_non_eu_share_bin_high)

## High non-EU foreigner share x Pool season = summer_bin_foreign_non_eu_share_bin_high

m1 <- feols(vote_afd ~ summer_bin_foreign_non_eu_share_bin_high  | user_id + date, 
            data = dat, 
            cluster = ~ user_id) 

etable(m1)
